import 'package:flutter/material.dart';
import 'package:module_discover/pages/filter_domain/filter_domain_logic.dart';
import 'package:module_discover/pages/filter_domain/view/round_input_field.dart';

/// 输入框2类型
class ChildInput2Widget extends StatelessWidget {
  final String name;
  FilterDomainLogic logic;
  final String fieldKey1;
  final ValueChanged<String>? onChanged1;
  final String fieldKey2;
  final ValueChanged<String>? onChanged2;

  ChildInput2Widget({
    super.key,
    required this.logic,
    required this.name,
    required this.fieldKey1,
    required this.onChanged1,
    required this.fieldKey2,
    required this.onChanged2,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        SizedBox(height: 10),
        Text(
          name,
          style: TextStyle(
            fontSize: 13,
            color: Colors.black,
            fontWeight: FontWeight.bold,
          ),
        ),
        Row(
          children: [
            Expanded(
              child: RoundInputField(
                fieldKey: fieldKey1,
                logic: logic,
                onChanged: onChanged1,
              ),
            ),
            Container(
              width: 10,
              margin: EdgeInsets.symmetric(horizontal: 10),
              child: Divider(
                color: Colors.black,
                height: 0.5,
              ),
            ),
            Expanded(
              child: RoundInputField(
                fieldKey: fieldKey2,
                logic: logic,
                onChanged: onChanged2,
              ),
            ),
          ],
        )
      ],
    );
  }
}
